package sipus.database.model;

// Generated Apr 5, 2010 4:05:36 PM by Hibernate Tools 3.2.4.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.envers.Audited;

/**
 * RolePrivilage generated by hbm2java
 */
@Entity
@Audited
@Table(schema = "public", name = "role_privilage")
public class RolePrivilage implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2114693380000282945L;
	private Long id;
	private String oleh;

	public String toString() {
		return role + "";
	}

	public void setOleh(String oleh) {
		this.oleh = oleh;
	}

	public String getOleh() {
		return oleh;
	}

	private Date tanggal_dirubah = new Date();

	public void setTanggal_dirubah(Date tanggal_dirubah) {
		this.tanggal_dirubah = tanggal_dirubah;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getTanggal_dirubah() {
		return tanggal_dirubah;
	}

	private Tbmrole role;
	private Menu menu;
	private Integer read;
	private Integer update;
	private Integer create;
	private Integer delete;

	public RolePrivilage() {
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", insertable = false, unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "role", nullable = true)
	public Tbmrole getRole() {
		return this.role;
	}

	public void setRole(Tbmrole role) {
		this.role = role;
	}

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "menu", nullable = true)
	public Menu getMenu() {
		return this.menu;
	}

	public void setMenu(Menu menu) {
		this.menu = menu;
	}

	@Column(name = "_read", nullable = true)
	public Integer getRead() {
		return this.read;
	}

	public void setRead(Integer read) {
		this.read = read;
	}

	@Column(name = "_update", nullable = true)
	public Integer getUpdate() {
		return this.update;
	}

	public void setUpdate(Integer update) {
		this.update = update;
	}

	@Column(name = "_create", nullable = true)
	public Integer getCreate() {
		return this.create;
	}

	public void setCreate(Integer create) {
		this.create = create;
	}

	@Column(name = "_delete", nullable = true)
	public Integer getDelete() {
		return this.delete;
	}

	public void setDelete(Integer delete) {
		this.delete = delete;
	}

}
